package com.banzhi.shop.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.banzhi.shop.MyApp;
import com.banzhi.shop.R;
import com.banzhi.shop.utils.Translucent;
import com.nostra13.universalimageloader.utils.L;

public class PintuanOrderActivity extends AppCompatActivity implements View.OnClickListener {

    private LinearLayout mLl_1;
    private LinearLayout mLl_2;
    private LinearLayout mLl_3;
    private ImageView mBack;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pintuan_order);
        Translucent.setTranslucent(this);
        initView();
        initListener();
    }

    private void initView() {
        mLl_1 = (LinearLayout) findViewById(R.id.ll_1);
        mLl_2 = (LinearLayout) findViewById(R.id.ll_2);
        mLl_3 = (LinearLayout) findViewById(R.id.ll_3);
        mBack = (ImageView) findViewById(R.id.iv_back);
        if ("1".equals(MyApp.loginMessage.getString("isagent", ""))) {
            mLl_1.setVisibility(View.VISIBLE);
        }else {
            mLl_1.setVisibility(View.GONE);
        }

    }

    private void initListener() {
        mLl_1.setOnClickListener(this);
        mLl_2.setOnClickListener(this);
        mLl_3.setOnClickListener(this);
        mBack.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ll_1:
                Intent intent = new Intent(this, MyGroupingActivity2.class);
                startActivity(intent);
                break;
            case R.id.ll_2:
               startActivity(new Intent(this,MyGroupActivity3.class));
                break;
            case R.id.ll_3:
                startActivity(new Intent(this,BuyOrderActivity.class));
                break;
            case R.id.iv_back:
                finish();
                break;
        }

    }
}
